<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" th:href="@{/css/index.css}">
    <link rel="stylesheet" th:href="@{/css/mainmenu.css}">
    <link rel="stylesheet" th:href="@{/css/tanchuang.css}">
    <script language="JavaScript" th:src="@{/script/index.js}"></script>

</head>
<body>

    <div id="Div_container">
        <div id="div_fruit">
            <form th:action="@{/indexSearch}" method="get">
                <input type="hidden" name="userid" th:value="|${session.user.getUserId()}|">
                <div style="border: 1px solid red;width: 60%; margin-left: 20%">
                    <a th:href="@{/add.html}" class="add_A">LW商城</a>
                </div>
                <div class="div_index">
                    <span class="span_index">首页</span>
                    <input class="search_input" name="productName" type="text" th:placeholder="请输入商品名">
                    <button  class="search_btn" type="submit"><img class="search_img" th:src="@{/images/search.png}"></button>
                    <div class="mainmenu">
                        <ul>
                            <li><a><img class="shopping_img" th:src="@{/images/更多设置图标.jpg}"></a>
                                <ul>
                                    <li><a th:href="@{/accManage}" style="z-index: 9">账号管理</a></li>
                                    <li><a th:href="@{/login}" style="z-index: 9">切换用户</a></li>
                                    <li th:if="${session.user.getUserType().equals('business')}"><a th:href="@{/business/addGoods}" style="z-index: 9">添加商品</a></li>
                                    <li th:if="${session.user.getUserType().equals('business')}"><a th:href="@{/business/GoodList}" style="z-index: 9">商品列表</a></li>
                                    <li th:if="${session.user.getUserType().equals('business')}"><a th:onclick="|exit(${session.user.getUserId()})|" style="z-index: 9">取消入驻</a></li>
                                </ul>
                            </li>
                        </ul>
                    </div>
                    <button class="shopping_car" type="button" th:onclick="cart()"><img class="shopping_img" th:src="@{/images/购物车.webp}"></button>

                </div>

                <div class="Goods_container">
                    <div class="box" th:each="good : ${ProductBases}" th:object="${good}">
                        <div class="img-box">
                            <img th:onclick="|shoppingInfo(*{getProductId()})|" th:src="@{|/userImg/*{productImg}|}"><br>
                        </div>
                        <div class="text-box">
                            <div>
                                <h2 th:text="|销售额:*{sellNum}|">销售额：9000+</h2>
                                <h2 th:text="|价格:*{productPrice}|">价格：4.5</h2>
                            </div>
                        </div>
                    </div>

                </div>

            </form>

            <div class="div_good">
                <div class="table_type">
                    <span id="type_span">分类</span>
                    <a th:each="proType : ${productTypeList}" th:object="${proType}"><p th:onclick="|productType(*{productTypeId})|" th:text="*{productTypeName}">服装</p></a>
                </div>
            </div>


            <div class="div_buy">
                <label>抢购活动</label>
                <div class="buy_box">
                    <div class="img-box">
                        <img id="buy_img" th:onclick="purchase()" th:src="@{/images/现时抢购.jpg}"/>
                    </div>
                </div>
            </div>
            <div class="div_login" th:if="${session.user.getUserId()==-1}">
                <a th:href="@{/login}"><img class="img_login" th:src="@{/images/登录头像.jpg}"></a>
<!--                规定如果用户id等于-1，则说明该用户没有登录系统，只是查看信息而已 此时就显示“登录”按钮提示用户登录-->
                <button class="button_function" th:onclick="login()">登录</button>
                <button class="button_function" th:onclick="register()">注册</button>
            </div>
            <div class="div_login" th:unless="${session.user.getUserId()==-1}">
                <a th:href="@{|/userInfo/ownerInfo|}"><img style="margin-top: 5%;margin-left: 30%" class="img_login" th:src="@{|/userImg/${session.user.getUserImg()}|}"></a>
                <span th:text="|${session.user.getUserName()},欢迎您!!|"></span>
            </div>

            <div class="user_function">
                <button id="shopping" class="button_function">商品收藏</button>
                <button id="purchase" class="button_function">订单详情</button>
                <button id="history" class="button_function">我的足迹</button>
                <button id="joinShopping" class="button_function">入驻商城</button>
            </div>

            <!-- 弹窗 -->
            <div class="alert-shopping">
                <div class="alert-body">
                    <div class="alert-title">
                        <div id="idClose" class="close">x</div>
                        商品收藏
                    </div>
                    <div class="alert-content">
                        <div class="tanchuang_container">

                            <div class="tanchuang_container_title">
                                <span class="tanchuang_span">LW商场欢迎您</span>
                                <form th:action="@{/user/collect}" method="get">
                                    <button style="float: right;" class="search_btn" type="submit"><img class="search_img" th:src="@{/images/search.png}"></button><input style="font-size: 24px;margin-left: 5px;padding-left: 5px" name="collectSearch" class="tanchuang_search">
                                </form>
                            </div>

                            <div class="collect_list">

                                <div class="collect_date">

                                    <table class="collect_date_table" border="1" cellspacing="0">
                                        <tr class="tr_th">
                                            <th>日期时间</th>
                                        </tr>
                                        <tr>
                                            <td>日期1</td>
                                        </tr>
                                        <tr>
                                            <td>日期2</td>
                                        </tr>
                                        <tr>
                                            <td>日期3</td>
                                        </tr>
                                        <tr>
                                            <td>日期3</td>
                                        </tr>
                                        <tr>
                                            <td>日期3</td>
                                        </tr>
                                        <tr>
                                            <td>日期3</td>
                                        </tr>
                                        <tr>
                                            <td>日期3</td>
                                        </tr>
                                        <tr>
                                            <td>日期3</td>
                                        </tr>
                                    </table>
                                </div>

                                <div class="collect_context">
                                    <div class="collect_context_div" th:each="collect : ${collectList}" th:object="${collect}">
                                        <img th:src="@{|/userImg/*{product.productImg}|}">
                                        <span th:text="*{product.getProductName()}">收藏内容</span>
                                        <label th:text="*{collectDate}">收藏时间</label>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="alert-purchase">
                <div class="alert-body">
                    <div class="alert-title">
                        <div id="idPurchase" class="close">x</div>
                        订单详情
                    </div>
                    <div class="alert-content">
                        <div class="tanchuang_container">

                            <div class="tanchuang_container_title">
                                <span class="tanchuang_span">LW商场欢迎您</span>
                                <form th:action="@{/user/order}" method="get">
                                    <button  style="float: right;" class="search_btn" type="submit"><img class="search_img" th:src="@{/images/search.png}"></button><input style="font-size: 24px;margin-left: 5px;padding-left: 5px" placeholder="请输入日期" name="orderSearch" class="tanchuang_search">
                                </form>
                            </div>

                            <div class="collect_list">

                                <div class="collect_date">

                                    <table class="collect_date_table" border="1" cellspacing="0">
                                        <tr class="tr_th">
                                            <th>日期时间</th>
                                        </tr>
                                        <tr>
                                            <td>日期1</td>
                                        </tr>
                                        <tr>
                                            <td>日期2</td>
                                        </tr>
                                        <tr>
                                            <td>日期3</td>
                                        </tr>
                                    </table>
                                </div>

                                <div class="collect_context">
                                    <div class="collect_context_div_oder" th:each="payTable:${payTableList}" th:object="${payTable}">
                                        <div class="up">
                                            <p th:text="*{payDate}">订单时间</p>
                                        </div>

                                        <span th:text="|你花了*{payTotalPrice}元,买了*{getOrderList().size()}种商品|">订单内容:</span>

                                        <div class="down">
                                            <a th:href="@{|/user/CancelOrder/*{payId}|}">取消订单</a>
                                            <a th:if="*{payStatus==0}" th:href="@{|/user/PayOrder/*{payId}|}">确认收货</a>
                                            <a th:if="*{payStatus==1}">已收货</a>
                                            <a th:href="@{|/user/orderDetail/*{payId}|}">查看详情</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="alert-history">
                <div class="alert-body">
                    <div class="alert-title">
                        <div id="idHistory" class="close">x</div>
                        我的足迹
                    </div>
                    <div class="alert-content">
                        <div class="tanchuang_container">

                            <div class="tanchuang_container_title">
                                <span class="tanchuang_span">LW商场欢迎您</span>
                                <form th:action="@{/user/history}" method="get">
                                    <button  style="float: right;" class="search_btn" type="submit"><img class="search_img" th:src="@{/images/search.png}"></button><input style="font-size: 24px;margin-left: 5px;padding-left: 5px" name="history" class="tanchuang_search">
                                </form>
                            </div>

                            <div class="collect_list">

                                <div class="collect_date">

                                    <table class="collect_date_table" border="1" cellspacing="0">
                                        <tr class="tr_th">
                                            <th>日期时间</th>
                                        </tr>
                                        <tr >
                                            <td>日期1</td>
                                        </tr>
                                        <tr>
                                            <td>日期2</td>
                                        </tr>
                                        <tr>
                                            <td>日期3</td>
                                        </tr>
                                    </table>
                                </div>

                                <div class="collect_context">
                                    <div class="collect_context_div" th:each="record : ${recordList}" th:object="${record}">
                                        <img th:src="@{|/userImg/*{product.productImg}|}">
                                        <span th:text="*{product.getProductName()}">预览内容</span>
                                        <label th:text="*{recordDate}">预览时间</label>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="alert-joinShopping">
                <div class="alert-body">
                    <div class="alert-title">
                        <div id="idJoin" class="close">x</div>
                        入驻商城
                    </div>
                    <div class="alert-content">
                        <div class="tanchuang_container">

                            <div class="tanchuang_container_title">
                                <span class="tanchuang_span">LW商场欢迎您</span>
                            </div>
                            <div class="tanchuang_join">
                                <form th:action="@{/user/joinLW}" method="post">
                                    <label>店名</label>
                                    <input name="proName" placeholder="请输入店名">
                                    <label>你的姓名</label>
                                    <input name="userName" placeholder="请输入你的名字">
                                    <label>地址</label>
                                    <input name="addr" placeholder="请输入地址">
                                    <label>联系电话</label>
                                    <input name="phone" placeholder="请输入电话">
                                    <button type="submit">入驻</button>

                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>


        </div>

        <div class="div_page">
            <input type="hidden" name="page_userid" th:value="|${session.user.getUserId()}|">
            <input th:unless="${curPage}==1" type="button" value="首 页" th:onclick="|page(1,${session.user.getUserId()})|">
            <input th:unless="${curPage}==1" type="button" value="上一页" th:onclick="|page(${curPage-1},${session.user.getUserId()})|">

            <input th:each="tem : ${temp}" type="button" th:value="${tem}" th:onclick="|page(${tem},${session.user.getUserId()})|">

            <input th:unless="${curPage}==${allPage}" type="button" value="下一页" th:onclick="|page(${curPage+1},${session.user.getUserId()})|">
            <input th:unless="${curPage}==${allPage}" type="button" value="尾 页" th:onclick="|page(${allPage},${session.user.getUserId()})|">
        </div>
    </div>

    <script language="JavaScript" th:src="@{/script/tanchuang.js}"></script>

</body>
</html>
